<?php

/**
 * Subclass for representing a row from the 'sf_simple_wiki_content' table.
 *
 *
 *
 * @package plugins.nahoWikiPlugin.lib.model
 */
class PluginnahoWikiContent extends BasenahoWikiContent
{

  protected $gz_content_unstreamed = null;

  public function getGzContent()
  {
    if (is_null($this->gz_content_unstreamed))
    {
      $v = parent::getGzContent();

      if (is_resource($v))
      {
        $str = '';
        while ($part = fread($v, 1024))
        {
          $str .= $part;
        }
        $this->gz_content_unstreamed = $str;
      }
      else
      {
        // it's not a stream
        $this->gz_content_unstreamed = strval($v);
      }
    }

    return $this->gz_content_unstreamed;
  }

}
